package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.dao.DishDao;
import com.example.domain.Dish;
import com.example.dto.DishDto;
import com.example.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishServiceImpl extends ServiceImpl<DishDao, Dish> implements DishService {
    @Autowired
    private DishDao dishDao;
    @Override
    public int selectByCategoryId(Long id) {
        return dishDao.selectByCategoryId(id);
    }

    @Override
    public List<Dish> selectall(int pageCount, int pageSize) {
        return dishDao.selectall(pageCount,pageSize);
    }

    @Override
    public int selectcount() {
        return dishDao.selectcount();
    }

    @Override
    public List<Dish> selectbyname(int pageSize, int pageCount, String name) {
        return dishDao.selectbyname(pageCount,pageSize,name);
    }

    @Override
    public void save(DishDto dishDto) {
        dishDao.save(dishDto);
    }

    @Override
    public Dish selectbyid(Long id) {
        return dishDao.selectbyid(id);
    }

    @Override
    public void update(DishDto dishDto) {
        dishDao.update(dishDto);
    }

    @Override
    public void dishStatusByStatus(Dish dish) {
        dishDao.dishStatusByStatus(dish);
    }

    @Override
    public void deleteDish(Long id) {
        dishDao.deleteDish(id);
    }

    @Override
    public List<Dish> selectbycategoryid(Long id) {
        return dishDao.selectbycactegoryid(id);
    }

    @Override
    public List<Dish> selectbycategoryidandstatus(Dish dish) {
        return dishDao.selectbycategoryidandstatus(dish);
    }
}
